﻿using System.ServiceProcess;

namespace DebuggableWindowsService
{
    public partial class WindowsServiceHarness : ServiceBase
    {
        private readonly IWindowsService _implementer;

        internal WindowsServiceHarness()
        {
            InitializeComponent();
        }

        public WindowsServiceHarness(IWindowsService implementation) : this()
        {
            _implementer = implementation;
        }

        protected override void OnStart(string[] args)
        {
            _implementer.OnStart(args);
        }

        protected override void OnStop()
        {
            _implementer.OnStop();
        }

        protected override void OnPause()
        {
            _implementer.OnPause();
        }

        protected override void OnContinue()
        {
            _implementer.OnContinue();
        }

        protected override void OnShutdown()
        {
            _implementer.OnShutdown();
        }
    }
}
